import pyautogui
import time
#import cnpy
try:
    while True:
        # 获取当前鼠标的坐标
        x, y = pyautogui.position()
        print(f"Mouse position: X={x}, Y={y}")
        time.sleep(1)
except KeyboardInterrupt:
    print("Program terminated.")